<div id="leftcol">
	<?php echo link_to('Manage Products', array('controller' => 'staff', 'action' => 'product')); ?>
	<?php echo link_to('Manage Playgroundequipment', array('controller' => 'staff', 'action' => 'playgroundEquipment')); ?>
</div>

<div id="rightcol">

</div>

<div id="centercol">

<h2>All Products</h2>

<?php render_in_table_advanced($this->products, 'staff', 'product', array('created_at', 'created_by', 'updated_at', 'updated_by', 'comments_count')); ?>


<h3><%= ($_GET['id']) ?  "Edit Product" : "New Product"; %></h3>
<?php

	start_form_tag('staff/product/' . $_GET['id'], array('multipart' => true, 'name' => 'Uploader'));
	render_form_for_advanced('product', array('name', 'description', 'height', 'length', 'width', 'material', 'price', 'mounting_price', 'warentee', 'parts', 'labour', 'manufacture_time', 'specification', 'features'));
	render_check_boxes_advanced('equipments', $_GET['id'], $this->product->playgroundequipments, $this->all_playground_equipments, 'name');

?>


<h1>Multiple File Upload</h1>

<script language="javascript">
<!--
function add_more_upload() {
	var new_total = Math.round(document.Uploader.TOTAL_FILE.value) + 1;
	document.getElementById('attach_'  + document.Uploader.TOTAL_FILE.value).innerHTML = 
	"<input type='file' size='60' name='images[]' /></div><div id='attach_" + new_total  + "'>";
	document.Uploader.TOTAL_FILE.value++;
}
-->
</script>

File to Upload: 
<div id='attach'>
<input type="file" size="60" name="images[]" />
</div>
<div id='attach_0'></div>
<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
<input type="hidden" name="TOTAL_FILE" value="0" />
<br />

<input type='button' value='Upload More' onClick="add_more_upload()" />
	<?php ($_GET['id']) ? submit_tag("Edit") : submit_tag("New"); ?>
	<?php if ($_GET['id']) { link_to("Cancel", array("controller" => "staff", "action" => "product")); } ?>
	
	<?php end_form_tag(); ?>

</div>